﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XQ.SP.Common
{

    [Serializable]
    public class EunmToListItem
    {
        public string Text { get; set; }
        public string Value { get; set; }
        public string Description { get; set; }
    }

    public class EnumToListComm
    {
        public List<EunmToListItem> EnumToList<T>()
        {
            List<EunmToListItem> list = new List<EunmToListItem>();
            foreach (string item in Enum.GetNames(typeof(T)))
            {
                list.Add(new EunmToListItem() { Text = item, Value = ((int)Enum.Parse(typeof(T), item)).ToString() });
            }
            return list;
        }
    }

}


